<%@ Control Language="C#" AutoEventWireup="true" Codebehind="Categories.ascx.cs"
    Inherits="Doctors_WebForum.Admin.UIControls.Categories" %>
<div class="tab_content">
    <div class="pageIntro">
        <h2>
            Managerment Categories</h2>
        <p>
            Here's administrator can update/view/delete information about categories</p>
    </div>
    <div class="contentBox">
        <div class="contentBoxTop">
            <h3>
                <asp:LinkButton ID="lbkListUser" runat="server" OnClick="lbkListUser_Click">List information about categories is exits in forum</asp:LinkButton></h3>
            <label id="search" class="smallInput">
                Quick Find :
                <asp:TextBox AutoPostBack="true" ID="txtSearch" runat="server" OnTextChanged="txtSearch_TextChanged"></asp:TextBox>
            </label>
        </div>
        <div class="innerContent">
            <!--Message will active if cann not load data-->
            <asp:Label ID="lblMessage" runat="server"></asp:Label>
            <!--Load list users with paging using datalist controls-->
            <asp:DataList ID="dtlUser" runat="server" CssClass="sTable" DataKeyField="CategoryID"
                OnEditCommand="dtlUser_EditCommand" OnCancelCommand="dtlUser_CancelCommand" OnUpdateCommand="dtlUser_UpdateCommand"
                OnDeleteCommand="dtlUser_DeleteCommand">
                <HeaderTemplate>
                    <thead id="table_header">
                        <tr>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkCategoryID" OnClick="CategoryID" runat="server">CateID</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkParentID" OnClick="ParentID" runat="server">SubID</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkTitle" OnClick="Title" runat="server">Title</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>Description</strong>
                            </th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkOrder" OnClick="Order" runat="server">Order</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkStatus" OnClick="Status" runat="server">Status</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>Edit</strong>
                            </th>
                        </tr>
                    </thead>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="oddRow">
                        <td class="firstCol">
                            <a href="Default.aspx?view=Categories&Id=<%#Eval("CategoryID") %>">
                                <%#DataBinder.Eval(Container.DataItem,"CategoryID")%>
                            </a>
                        </td>
                        <td class="secondCol">
                            <%#Eval("ParentID")%>
                        </td>
                        <td>
                            <%#Eval("Title")%>
                        </td>
                        <td>
                            <%#Eval("Description")%>
                        </td>
                        <td>
                            <%#Eval("Order")%>
                        </td>
                        <td>
                            <%--OnCheckedChanged="chkStatus_OnCheckedChanged"--%>
                            <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Convert.ToBoolean(Eval("Status")) %>'
                                Text='<%# Eval("Status").ToString().Equals("True") ? " Active " : " UnActive " %>' />
                        </td>
                        <td class="editItem">
                            <ul>
                                <li class="iconEdit">
                                    <asp:LinkButton Text="edit" CommandName="Edit" runat="server" ID="lbtnEdit" />
                                </li>
                                <li class="iconDel">
                                    <asp:LinkButton Text="delete" CommandName="Delete" runat="server" ID="lbtnDelete"
                                        OnClientClick="return confirm ('Are you sure want to delete ?')" />
                                </li>
                            </ul>
                        </td>
                    </tr>
                </ItemTemplate>
                <EditItemTemplate>
                    <tr class="edit_content">
                        <td>
                            <%#Eval("CategoryID")%>
                        </td>
                        <td class="secondCol">
                            <asp:TextBox Width="30px" ID="txtParentID" runat="server" Text='<%#Eval("ParentID") %>'></asp:TextBox>
                        </td>
                        <td class="HeightDescription">
                            <asp:TextBox ID="txtTitle" TextMode="MultiLine" runat="server" Text='<%#Eval("Title") %>'>
                            </asp:TextBox>
                        </td>
                        <td class="HeightDescription">
                            <asp:TextBox ID="txtDescription" TextMode="MultiLine" Text='<%#Eval("Description") %>'
                                runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox Width="30px" ID="txtOrder" Text='<%#Eval("Order") %>' runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Convert.ToBoolean(Eval("Status")) %>'
                                Text='<%# Eval("Status").ToString().Equals("True") ? " Active " : " UnActive " %>' />
                        </td>
                        <td class="editItem">
                            <ul>
                                <li class="iconCancel">
                                    <asp:LinkButton Text="cancel" CommandName="Cancel" runat="server" ID="lbtnCancel" />
                                </li>
                                <li class="iconUpdate">
                                    <asp:LinkButton Style="float: right;" Text="update" CommandName="Update" runat="server"
                                        ID="lbtnUpdate" />
                                </li>
                            </ul>
                        </td>
                    </tr>
                </EditItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:DataList>
            <asp:Label ID="lblResultPaging" runat="server" Visible="false"></asp:Label>
            <table border="0" cellpadding="0" cellspacing="0" id="pagging_box">
                <tr>
                    <td valign="middle">
                        <asp:LinkButton ID="lbtnPrevious" runat="server" Text="Previous Page" class="selected"
                            OnClick="lbtnPrevious_Click">Previous</asp:LinkButton>
                    </td>
                    <td valign="middle" align="right">
                        <asp:DataList ID="DLPAGING" runat="server" RepeatDirection="Horizontal" OnItemCommand="DLPAGING_ItemCommand">
                            <ItemTemplate>
                                <asp:LinkButton ID="imgbtnNumber" class="selected" runat="server" Text='<%# Eval("DisplayName") %>'
                                    Visible='<%# Eval("LinkButtonVisible") %>' CommandArgument='<%# Eval("Value") %>'
                                    CommandName="Paging" />
                                <asp:Label class="paging" ID="lblNumber" runat="server" ToolTip="Selected Page" Visible='<%# Eval("LabelVisible") %>'
                                    Text='<%# "&nbsp;"+ Eval("DisplayName") + "&nbsp;"%>'></asp:Label>
                            </ItemTemplate>
                        </asp:DataList>
                    </td>
                    <td valign="middle">
                        <asp:LinkButton ID="lbtnNext" runat="server" class="selected" Text="Next Page" OnClick="NextPage">Next</asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>
        <!--end of #box-3-->
    </div>
    <div class="contentBox" id="pages">
        <div class="contentBoxTop">
            <h3>
                Managerment information of categories</h3>
            <ul class="switcherTabs">
                <li class="selected"><a href="#box-1">Add New</a></li>
                <!-- the link location of this tab refers to the id of the related div -->
            </ul>
        </div>
        <div class="innerContent" id="box-1">
            <p style="width: 300px;">
                Parent ID
                <label class="dropdownlist">
                    <asp:DropDownList ID="drpParent" runat="server" Width="300px">
                    </asp:DropDownList>
                </label>
            </p>
            <div style="margin-top: 5px !important; padding-top: 5px !important;">
                <p>
                    Order
                    <label>
                        <asp:TextBox Width="50px" ID="txtOrder" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                            ID="RequiredFieldValidator3" ControlToValidate="txtOrder" ValidationGroup="grCate"
                            runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="must number"
                            ControlToValidate="txtOrder" ValidationGroup="grCate" ValidationExpression="\d"></asp:RegularExpressionValidator>
                    </label>
                    Status
                    <label>
                        <asp:CheckBox ID="chkStatus" runat="server" />
                    </label>
                </p>
            </div>
            <p>
                Title
                <br />
                <label class="mediumInput">
                    <asp:TextBox ID="txtTitle" MaxLength="200" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ControlToValidate="txtTitle" ValidationGroup="grCate"
                        ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </label>
            </p>
            <p>
                Description
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtDescription"
                    ValidationGroup="grCate" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                <br />
                <label class="textarea">
                    <asp:TextBox TextMode="MultiLine" ID="txtDescription" runat="server"></asp:TextBox>
                </label>
            </p>
            <p>
            <p>
                <label>
                    <asp:Label ID="lblError" runat="server"></asp:Label>
                </label>
            </p>
            <p id="submit_button">
                <asp:Button ValidationGroup="grCate" ID="btnAddNew" runat="server" OnClick="btnAddNew_Click" />
            </p>
        </div>
    </div>
</div>
